home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1046 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: clamage@Eng.Sun.COM (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Array function params and const qualifier
  5. Date: 11 Apr 1996 17:27:59 PDT
  6. Organization: Sun Microsystems Inc.
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4kjqqa$bol@engnews1.Eng.Sun.COM>
  9. References: <4ke06a$rp3@mozart.wg.icl.co.uk>
  10. Reply-To: clamage@Eng.Sun.COM
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: 11 Apr 1996 20:41:46 GMT
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMW2jkUy4NqrwXLNJAQGZkgH+LZBCl1vc3gTcv1PmEtv8Z3ME6t9WjZ0C
  15.     caBRVEPy5pP3k0YV/+mxI4R7ZhGVQKOkdiu8up/FZ0HUOJYQ0tsKUA==
  16.     =8UDH
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. In article rp3@mozart.wg.icl.co.uk, Adel El-Beik <A.El-Beik@man0506.wins.icl.co.uk> writes:
  20. >I have a question concerning MSVC++ v.4.00 and the April DWP C++.
  21. >
  22. >The following code fails on MSVC++.  It doesn't like line labelled 1.
  23. >It complains with 
  24. >
  25. >C:\array\array.cpp(16) : error C2664: 'func' : cannot convert parameter 1 
  26. >from 'long [2][2]' to 'const long [][2]' (new behavior; please see help)
  27.  
  28. You have run into effectively the same rule that prohibits implicit
  29. conversion from "T**" to "const T**". That prohibition is not new,
  30. but is in the ISO/ANSI C standard, and has not been changed, since
  31. it would open a hole in the type system.
  32.  
  33. I believe the subject is covered in the comp.lang.c FAQ list.
  34.  
  35. ---
  36. Steve Clamage, stephen.clamage@eng.sun.com
  37. ---
  38. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  39.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  40.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  41.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  42.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  43. ]
  44.